package com.example.shop;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class DBHelper extends SQLiteOpenHelper {
    private static final int DB_VERSION = 1;
    public static final String U_USERINFO = "userinfo";// 个人资料
    public static final String U_COMMODITY = "Commodity";

    public DBHelper(Context context){
        super(context,"record.db",null,DB_VERSION);
    }


    @Override
    public void onCreate(SQLiteDatabase db) {
        //创建订单表，新增用户名列
        String order_sql = "create table dingdan(_id integer primary key autoincrement,user char,title char,price char,date char)";
        String user_sql ="CREATE TABLE  IF NOT EXISTS userinfo (_id INTEGER PRIMARY KEY AUTOINCREMENT,userName VARCHAR,nickName VARCHAR, sex VARCHAR, signature VARCHAR)";
        String item_sql = "create table Commodity(_id integer primary key autoincrement,name varchar(20),profile varchar(50),price varchar(10),image varchar(255))";
        db.execSQL(order_sql);
        db.execSQL(user_sql);
        db.execSQL(item_sql);

    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
    }
}
